﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="ShoppingCart.aspx.cs" Inherits="ShoppingCart" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="Server">
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="BookStoreDataContext"
        EntityTypeName="" TableName="card_types" EnableDelete="True" EnableInsert="True"
        EnableUpdate="True">
    </asp:LinqDataSource>
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    </asp:ScriptManagerProxy>
    <asp:UpdatePanel ID="udPanel" runat="server">
        <ContentTemplate>
            <asp:GridView ID="grvShoppingCart" runat="server" DataKeyNames="ItemID" AutoGenerateColumns="False"
                OnRowDeleting="grvShoppingCart_RowDeleting" OnRowEditing="grvShoppingCart_RowEditing"
                AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" OnRowCancelingEdit="grvShoppingCart_RowCancelingEdit"
                OnRowUpdated="grvShoppingCart_RowUpdated" OnRowUpdating="grvShoppingCart_RowUpdating">
                <Columns>
                    <asp:BoundField DataField="ItemID" HeaderText="ItemID" InsertVisible="False" ReadOnly="True"
                        SortExpression="ItemID" />
                    <asp:BoundField DataField="ItemName" HeaderText="Item Name" SortExpression="ItemName" />
                    <asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" />
                    <asp:TemplateField HeaderText="Quantity" SortExpression="Quantity">
                        <ItemTemplate>
                            <asp:Label ID="lblQuantity" runat="server" Text='<%#Eval("Quantity") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtQuantity" runat="server" Text='<%#Eval("Quantity") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Amount" HeaderText="Amount" SortExpression="Amount" />
                    <%--<asp:ButtonField CommandName="Edit" Text ="Edit" />--%>
                </Columns>
            </asp:GridView>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:Button ID="btnBack" runat="server" Text="Back to Previous page" OnClick="btnBack_Click" /><asp:Button
        ID="btnFinish" runat="server" Text="Finish" OnClick="btnFinish_Click" />
    <p>
        <asp:Label ID="lblMessage" runat="server" Text="Label" Visible="false"></asp:Label>
    </p>
</asp:Content>
